﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title>Login</title>
<link href="../easyui/themes/default/easyui.css" rel="stylesheet"
	type="text/css" />
<link href="../easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<script src="../easyui/jquery.min.js" type="text/javascript"></script>
<script src="../easyui/jquery.easyui.min.js" type="text/javascript"></script>
<style type="text/css">
body {
	background-color: #338fcc;
}
</style>
<script type="text/javascript">
	$(function() {
		$("#win").window({
			title : "Login",
			iconCls : 'icon-man',
			width : 300,
			height : 250,
			collapsible : false,
			minimizable : false,
			maximizable : false,
			closable : false,
			closed : false,
			draggable : false,
			resizable : false,
			modal : true
		});
	});
	function login() {
		var name = $("#txt_name").val();
		var psd = $("#txt_psd").val();

		$.ajax({
			type : "POST",
			dataType : "json",
			url : "/studentmanagement/login/yh.do",
			data : {
				Method : "Login",
				username : name,
				password : psd
			},
			success : function(data) {
				var status = data.status;
				if (status == 1) {//跳转到主页面
					window.location.href = "./main.html";
				} else {
					$.messager.alert("消息", data.message, "info");
				}
			},
			error : function() {
				$.messager.alert("消息", "错误！", "info");
			}
		});
	}
	function reset() {
		$("#txt_name").val("");
		$("#txt_psd").val("");
		return false;
	}
</script>
</head>
<body>
	<form id="form1">
		<div id="win" class="easyui-window">
			<h2>用户登录</h2>
			<div class="demo-info" style="margin-bottom: 10px">
				<div class="demo-tip icon-tip"></div>
				<div>
					请输入账号和密码登录系统:<br />&nbsp;&nbsp;&nbsp;<span style="color: red;">初次登陆后请及时修改密码</span>
				</div>
			</div>
			<table>
				<tr>
					<td>账 号:</td>
					<td><input id="txt_name" type="text" /></td>
				</tr>
				<tr>
					<td>密 码:</td>
					<td><input id="txt_psd" type="password" /></td>
				</tr>
				<tr align="center">
					<td><a href="#" class="easyui-linkbutton" iconCls="icon-ok"
						onclick="login()">登录</a></td>
					<td><button class="easyui-linkbutton" iconCls="icon-cancel"
							onclick="reset()">重置</button></td>
				</tr>
			</table>
		</div>
	</form>
</body>
</html>